import request from '@/utils/request'
import ConstTable from './ConstTable'


// 获取客户信息
export function getCustomerInfo(id)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/${id}`,
        method: 'GET'
    })
}

// 获取客户信息列表
export function getCustomerList(data)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer`,
        method: 'GET',
        data
    })
}

// 添加客户信息
export function createCustomer(data)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer`,
        method: 'POST',
        data
    })
}

// 更新客户信息
export function updateCustomer(data)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/${data.id}`,
        method: 'PUT',
        data
    })
}

// 批量删除客户信息
export function delCustomerBatch(data)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/BatchRemove`,
        method: 'POST',
        data
    })
}
// 删除客户信息
export function delCustomer(id)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/${id}`,
        method: 'DELETE'
    })
}
// 获取所有客户信息
export function getCustomerAll()
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/All`,
        method: 'GET'
    })
}
// 导出客户信息
export function exportData(data)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/Actions/Export`,
        method: 'GET',
        data
    })
}
// 导入
export function ImportData(data)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/ImportData`,
        method: 'post',
        data
    })
}
// 导入预览
export function ImportPreview(data)
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/ImportPreview`,
        method: 'get',
        data
    })
}
// 模板下载
export function TemplateDownload()
{
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/Customer/TemplateDownload`,
        method: 'get'
    })
}
